package com.example.maze;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Parcel;
import android.os.Parcelable;

public class MyProgressDialog{
   private final ProgressDialog MY_PROGRESS_DIALOG;
   private Activity current;
   private boolean isShowing;
   
   public MyProgressDialog(Activity a) {
      current= a;
      MY_PROGRESS_DIALOG= new ProgressDialog(current);
      isShowing= false;
   }
   
//   public int getMax()               { return MY_PROGRESS_DIALOG.getMax(); }
//   public int getProgress()          { return MY_PROGRESS_DIALOG.getProgress(); }
//   public int getSecondaryProgress() { return MY_PROGRESS_DIALOG.getSecondaryProgress(); }
   //[ 開
   public void show(String title, String message) {
      isShowing= true;
      MY_PROGRESS_DIALOG.setTitle(title);
      MY_PROGRESS_DIALOG.setMessage(message);
      MY_PROGRESS_DIALOG.show();      
   }
   //[ 關
   public void dismiss() {
      isShowing= false;
      MY_PROGRESS_DIALOG.dismiss();
   }
   
   public void setIndeterminate (boolean indeterminate) {
      MY_PROGRESS_DIALOG.setIndeterminate(indeterminate);
   }
   
   public boolean hasShowed() { return isShowing; }
   
}
